<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./style.css">
</head>
<body>
    <div class="wrapper">
        <img src="./2.png" alt="" class="img1">
          <img src="./1.png" alt="" class="img2">
        <input type="range" min="0" 
        max="100" value="50" class="slider">
    </div>


      <script>

        const slider = document.querySelector(".slider");
        const img2 = document.querySelector(".img2");

        slider.addEventListener("input",()=>{
        let slideValue = slider.value;
        img2.style.clipPath = `polygon(0 0, ${slideValue}% 0,
        ${slideValue}% 100%,0 100% )`;
        })

      </script>
</body>
</html>